import codecs
import sys

gen_path = sys.argv[1]
org_path = sys.argv[2]
re_path = sys.argv[1] + '.lminput'

gens = codecs.open(gen_path, 'r', encoding='utf8').readlines()
orgs = codecs.open(org_path, 'r', encoding='utf8').readlines()

res = []
for g, o in zip(gens, orgs):
    story = o.split(' <SEP> ')[1]
    r = ' '.join([g.strip(), story])
    res.append(r)

re_file = codecs.open(re_path, 'w', encoding='utf8')
re_file.write(''.join(res))

